<template>
  <div class="special">
    <div class="disk" :class="{active:played}">
      <img src="../assets/disk.png" alt="" />
    </div>
    <div class="mid" :class="{playing:played}">
      <div class="blackborder">
        <img src="../assets/blackborder.png" alt="" />
      </div>
      <div class="disc">
        <img
          :src="playsong.song ? playsong.picUrl : playsong.al? playsong.al.picUrl:playsong.artists.img1v1Url"
          alt=""
        />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["playsong","played"],
};
</script>

<style lang="less" scoped>
.special {
  flex: 1;
  position: relative;
  .disk {
    position: absolute;
    width: 80px;
    height: 130px;
    top: 0;
    right: calc(50% - 80px / 2);
    transform: rotate(-30deg);
    transform-origin: top left;
    transition: all .6s;
    z-index: 1;
  &.active{
      transform: rotate(0deg);
  }
  }

  
  .mid {
    position: absolute;
    top: 90px;
    width: 100%;
   height: 284px;
    animation: spin 3s linear infinite;
    transform-origin: center;
    animation-play-state: paused;
    &.playing{
        animation-play-state: running;
    }
    .disc {
      width: 50%;
      border-radius: 50%;
      position: absolute;
      top: calc(50% - 177.5px / 2);
      right: calc(50% - 50% / 2);

      img {
        height: 100%;
        width: 100%;
        border-radius: 50%;
      }
    }
    .blackborder {
      position: absolute;
      top: 0;
      right: calc(50% - 284px / 2);
      width: 80%;
    }

  }
}
@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
</style>